<?php
    session_start();
    // Make posted code into upper case, then compare with the stored string 
    if(strtolower($_POST['code']) != $_SESSION['cap_code'])
    {
        echo 'no';
        // failed 
    }
    else
    {
        echo 'yes'; // passed 
    }
?>